package com.spider.methond;

public class MethondDemo2 {
    public static void main(String[] args) {
        //认识重载
    fire(10,20);
    fire(10.0,20.0);
    fire(1,2,3);
    }
    //需求：发射导弹
    public static void fire(int x,int y){
        System.out.println("发射导弹："+x+","+y);
    }
    //定义一个重载方法
    public static void fire(int x,int y,int z){
        System.out.println("发射导弹："+x+","+y+","+z);
    }
    public static void fire(double x,double y) {
        System.out.println("发射导弹：" + x + "," + y);
    }
    public static void fire(double x,double y,double z) {
        System.out.println("发射导弹：" + x + "," + y + "," + z);
    }

}
